using System;
using System.Collections.Generic;
using System.Globalization;
using System.Text;

namespace OpenFlashChartLib
{
    public class SketchGraphType : BarGraphType
    {
        public static readonly string SketchGraphToken = "bar_sketch";

        private int _offset;

        public SketchGraphType(int _alpha, int offset, string _color, string _legendText, int? _legendTextHeight) : 
            base(_alpha, _color, _legendText, _legendTextHeight)
        {
            Offset = offset;
        }

        public override string GraphTypeTocken
        {
            get
            {
                return SketchGraphToken;
            }
        }

        public int Offset
        {
            get { return _offset; }
            set { _offset = value; }
        }

        public override void RenderContent(System.Web.UI.HtmlTextWriter writer)
        {
            string token = GraphTypeTocken;
            if (ValueSet > 0)
                token += "_" + ValueSet;
            writer.Write(token);
            writer.Write("=");
            writer.Write(Alpha);
            writer.Write(",");
            writer.Write(Offset);
            writer.Write(",");
            writer.Write(Color);
            writer.Write(",");
            writer.Write(OulineColor);
            writer.Write(",");
            writer.Write(LegendText);
            if (LegendTextHeight != null)
            {
                writer.Write(",");
                writer.Write(LegendTextHeight.Value);
            }
        }
    }
}
